package IO流;

/**
 * @author:谢君臣
 * @Date:2021/5/17-20:38
 * @version:1.0
 * @function:
 */
public class 二进制 {
    public static void main(String[] args) {
        int n = 16;
        System.out.println(Integer.toBinaryString(n));
        System.out.println(Integer.toBinaryString(-n));
        System.out.println((n & -n)==n);

        System.out.println(16|4);


        int s = 0;
        int[] nums = {1,2,3,4,5,1,2,3,4,6};
        for (int num : nums) s ^=num;
        int k = 0;
        while ((s>> k & 1)!=1)k++;
        System.out.println(k);
        int num1=0;
        for (int num : nums) {
            if ((num>>k&1)==1)num1^=num;
        }
        int num2= s^num1;
        System.out.println(num1+","+num2);

    }

}
